The SHMVAR function creates an IDL array variable that uses the memory from a current mapped memory segment created by the SHMMAP procedure. Variables created by SHMVAR are used in much the same way as any other IDL variable, and provide the IDL user with the ability to alter the contents of anonymous shared memory or memory mapped files.
By default, the variable created by SHMVAR is given the type and dimensions that were specified to SHMMAP when the memory segment was created. However, this default can be changed by SHMVAR via a variety of keywords as well as via the Di arguments. The created array can be of any type except for pointer, object reference, or string. Structure types are allowed as long as they do not contain any pointers, object references, or strings.
Note: When assigning values to the returned array variable, explicitly make the assignment to the first element of the returned array. For example, the following creates a shared memory segment of 1000000 double-precision data elements, and then fills it with a DINDGEN ramp
SHMMAP, 'MYSEG', /DOUBLE, 1000000z = SHMVAR('MYSEG')z[0] = DINDGEN(1000000)
This technique maintains the array variable’s connection with the shared memory segment.
Result = SHMVAR(SegmentName [, D1, ..., D8] [, /BYTE] [, /COMPLEX] [, /DCOMPLEX] [, DIMENSION=value] [, /DOUBLE] [, /FLOAT] [, /INTEGER] [, /L64] [, /LONG] [, SIZE=value] [, TEMPLATE=value] [, TYPE=value] [, /UINT] [, /UL64] [, /ULONG] )
An IDL array variable that uses memory from the specified mapped memory segment.
A scalar string supplying the IDL name for the shared memory segment, as assigned by SHMMAP.
The dimensions of the result. The Di arguments can be either a single array containing the dimensions or a sequence of scalar dimensions. Up to eight dimensions can be specified. If no dimensions are specified, the parameters specified to SHMMAP are used.
Set this keyword to specify that the memory segment should be treated as a byte array.
Set this keyword to specify that the memory segment should be treated as a complex, single-precision floating-point array.
Set this keyword to specify that the memory segment should be treated as a complex, double-precision floating-point array.
Set this keyword equal to a vector of 1 to 8 elements specifying the dimensions of the result. This is equivalent to the array form of the Di plain arguments. If no dimensions are specified, the parameters specified to SHMMAP are used.
Set this keyword to specify that the memory segment should be treated as a double-precision floating-point array.
Set this keyword to specify that the memory segment should be treated as a single-precision floating-point array.
Set this keyword to specify that the memory segment should be treated as an integer array.
Set this keyword to specify that the memory segment should be treated as a 64-bit integer array.
Set this keyword to specify that the memory segment should be treated as a longword integer array.
Set this keyword equal to a size vector specifying the type and dimensions to be associated with the memory segment. The format of a size vector is given in the description of the SIZE function. If no dimensions are specified, the parameters specified to SHMMAP are used.
Set this keyword equal to a variable of the type and dimensions to be associated with the memory segment. If no dimensions are specified, the parameters specified to SHMMAP are used.
Set this keyword to specify the type code for the memory segment. See the description of the SIZE function for a list of IDL type codes.
Set this keyword to specify that the memory segment should be treated as an unsigned integer array.
Set this keyword to specify that the memory segment should be treated as an unsigned longword integer array.
Set this keyword to specify that the memory segment should be treated as an unsigned 64-bit integer array.
See the examples given for the SHMMAP procedure.
5.6 |
Introduced |